package net.noday.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/topic")
public class TopicController {

	@RequestMapping(value="/{id}", method=RequestMethod.GET)
	public String helloWorld(@PathVariable Long id,HttpServletRequest request, 
			HttpServletResponse response) {
		request.setAttribute("message", "you input topic id is:"+id);
		return "topic";
	}
	
	@RequestMapping("/add")
	public String test(HttpServletRequest request, HttpServletResponse response) {
		request.setAttribute("message", "hello!,@RequestMapping(value='/add')");
		return "topic";
	}

}
